package com.imu.purse.modules.trade.form;

import com.alibaba.fastjson.annotation.JSONField;
import com.imu.common.validator.group.AddGroup;
import com.imu.common.validator.group.UpdateGroup;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.NotBlank;

import javax.persistence.Column;
import java.math.BigDecimal;
import java.util.List;

@Data
public class ScanTransForm {

    //收款账号
    @JSONField(ordinal = 1)
    @Column(name="rec_account")
    @NotBlank(message="收款账号不能为空", groups = {AddGroup.class, UpdateGroup.class})
    @ApiModelProperty(value="收款账号", name="payAccount", required = true, example="13800000000")
    private String recAccount;

    //订单号
    @JSONField(ordinal = 2)
    @Column(name="order_no")
    @NotBlank(message="订单号不能为空", groups = {AddGroup.class, UpdateGroup.class})
    @ApiModelProperty(value = "订单号", name="orderNo", required = true, example="201801010100111")
    private String orderNo;

    /**
     * 原始币种类型1:人民币，2：港币
     */
    @JSONField(ordinal = 3)
    @Column(name="origin_type")
    @NotBlank(message="币种不能为空", groups = {AddGroup.class, UpdateGroup.class})
    @ApiModelProperty(value = "币种", name="originType", required = true, example="1")
    private Integer originType;

    @JSONField(ordinal = 4)
    @Column(name="total_money")
    @NotBlank(message="总金额不能为空", groups = {AddGroup.class, UpdateGroup.class})
    @ApiModelProperty(value = "总金额", name="totalMoney", required = true, example="10.52")
    private BigDecimal totalMoney;

    @JSONField(ordinal = 5)
    @Column(name="imu_to_rmb")
    @NotBlank(message="imu兑人民币汇率不能为空", groups = {AddGroup.class, UpdateGroup.class})
    @ApiModelProperty(value = "Imu兑人民币汇率", name="imuToRmb", required = true, example="10.52")
    private BigDecimal imuToRmb;

    @JSONField(ordinal = 6)
    @Column(name="gb_to_rmb")
    @NotBlank(message="港币兑人民币汇率不能为空", groups = {AddGroup.class, UpdateGroup.class})
    @ApiModelProperty(value = "港币兑人民币汇率", name="gbToRmb", required = true, example="0.8")
    private BigDecimal gbToRmb;

    @JSONField(ordinal = 7)
    @Column(name="need_money")
    @NotBlank(message="需支付的IMU不能为空", groups = {AddGroup.class, UpdateGroup.class})
    @ApiModelProperty(value = "需支付的IMU", name="needMoney", required = true, example="0.8")
    private BigDecimal needMoney;

    @JSONField(ordinal = 8)
    @Column(name="money")
    @NotBlank(message="实际支付的IMU不能为空", groups = {AddGroup.class, UpdateGroup.class})
    @ApiModelProperty(value = "实际支付的IMU", name="money", required = true, example="0.8")
    private BigDecimal money;

    /*@JSONField(ordinal = 9)
    @Column(name="pay_type")
    @NotBlank(message="支付类型不能为空", groups = {AddGroup.class, UpdateGroup.class})
    @ApiModelProperty(value = "支付类型", name="payType", required = true, example="1")
    private Integer payType;

    @JSONField(ordinal = 10)
    @Column(name="pay_money")
    @NotBlank(message="支付金额不能为空", groups = {AddGroup.class, UpdateGroup.class})
    @ApiModelProperty(value = "支付金额", name="payMoney", required = true, example="1")
    private BigDecimal payMoney;*/

    @JSONField(ordinal = 9)
    @NotBlank(message="支付密码不能为空", groups = {AddGroup.class, UpdateGroup.class})
    @ApiModelProperty(value = "支付金额", name="payPwd", required = true, example="11121")
    private String payPwd;

    /*@JSONField(ordinal = 11)
    @NotBlank(message="身份认证码不能为空", groups = {AddGroup.class, UpdateGroup.class})
    @ApiModelProperty(value = "身份认证码", name="saveCode", required = true, example="111111")
    private String saveCode;*/
    @JSONField(ordinal = 10)
    @NotBlank(message="图片验证码不允许为空", groups = {AddGroup.class, UpdateGroup.class})
    @ApiModelProperty(value = "图片验证码", name="code", required = true, example="111111")
    private String code;

    //交易时间
    @JSONField(ordinal = 11)
    @Column(name="order_create")
    @ApiModelProperty(value = "交易时间", name="orderCreate", required = true, example="100")
    private Long orderCreate;

    //描述详情
    @JSONField(ordinal = 12)
    @Column(name="detail")
    @ApiModelProperty(value = "描述", hidden = true)
    private String detail;

    //交易ID
    @ApiModelProperty(value = "交易ID", hidden = true)
    private String transId;

    //交易状态
    @ApiModelProperty(value = "交易状态", hidden = true)
    private Integer transStatus;

    @ApiModelProperty(value = "转账人地址", hidden = true)
    private String payAddr;

    @ApiModelProperty(value = "转账人手机号码", hidden = true)
    private String payPhone;

    @ApiModelProperty(value = "接受人地址", hidden = true)
    private String recAddr;

    @ApiModelProperty(value = "接受人手机号码", hidden = true)
    private String recPhone;

    @ApiModelProperty(value = "交易费用", hidden = true)
    private BigDecimal fee;

    @ApiModelProperty(value = "转出人ID", hidden = true)
    private Long payUserId;

    @ApiModelProperty(value = "接受人ID", hidden = true)
    private Long recUserId;

    @ApiModelProperty(value = "核心钱包地址", hidden = true)
    private String coreAddr;

    @ApiModelProperty(value = "交易表中ID", hidden = true)
    private List<Long> ids;

    @ApiModelProperty(value = "外部标记", hidden = true)
    private Boolean outFlag;
}
